package com.gcpproxy.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

@Data
@Accessors(chain = true)
@JsonIgnoreProperties(ignoreUnknown = true)
public class GeminiResponse implements Serializable {
    private static final long serialVersionUID = 1L;

    private String id;
    private String model;
    private String object;
    private long created;
    private List<Choice> choices;
    private Usage usage;

    @Data
    @Accessors(chain = true)
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Choice implements Serializable {
        private static final long serialVersionUID = 1L;
        private int index;
        private Message message;
        private String finishReason;
    }

    @Data
    @Accessors(chain = true)
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class Usage implements Serializable {
        private static final long serialVersionUID = 1L;
        private int promptTokens;
        private int completionTokens;
        private int totalTokens;
        private PromptTokensDetails promptTokensDetails;
        private CompletionTokensDetails completionTokensDetails;
        private int inputTokens;
        private int outputTokens;
        private Object inputTokensDetails;
    }

    @Data
    @Accessors(chain = true)
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class PromptTokensDetails implements Serializable {
        private static final long serialVersionUID = 1L;
        private int cachedTokens;
        private int textTokens;
        private int audioTokens;
        private int imageTokens;
    }

    @Data
    @Accessors(chain = true)
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class CompletionTokensDetails implements Serializable {
        private static final long serialVersionUID = 1L;
        private int textTokens;
        private int audioTokens;
        private int reasoningTokens;
    }
}
